package com.jason.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.jason.bean.Resource;
import com.jason.bean.Role;

public interface ResourceDao extends JpaRepository<Resource, Integer> {
	@Query(value="select r.* from role_resource rr,resource r where rr.resource_id=r.id and rr.role_id=?",nativeQuery=true)
	public List<Resource> findByRoleId(Integer id);
}
